sign — sign of the argument
sign
returns the sign of the argument. If the argument is
greater than zero, it returns 1. If the argument is less than zero,
it returns -1. Otherwise zero is returned. If the argument is a
matrix, the operation is performed element-by-element, returning a
matrix of the same dimensions as the argument.
If the argument is complex, then sign
returns the argument
divided by its magnitude.
This is not an built-in function. This function
is normally loaded on start-up from the sign.r
file in the
standard rlib
directory. Use of the -r
option, incorrectly
setting the RLAB_LIB_DIR
environmental variable, or modifying
sign.r
may make this function unavailable.
Subsections